<?php

namespace app\api\model;
use app\common\model\CharitableArticle as CharitableArticleModel;

class CharitableArticle extends CharitableArticleModel
{
    /**
     * 读取对应慈善分类及对应语言的文章
     * @param $cid
     * @param int $page
     * @param int $limit
     * @param string $language
     * @return array
     * @throws \think\db\exception\DbException
     */
    public static function getApiList($cid,$page = 1,$limit = 20,$language = 'traditional'){
        $where['language'] = id_language($language);
        $where['cid'] = $cid;

        $res = self::where($where)->order('id desc')->paginate(['list_rows'=>$limit,'page'=>$page])->toArray();
        return $res;
    }

    public static function getApiDetails(){

    }
}